module nade.view;

import derelict.opengl.gl;

import nade.matrix;
import nade.region;


class View {
	void render(const Region2 viewport)
	{
		glPushAttrib(GL_VIEWPORT_BIT);
		glViewport(viewport.min.x, viewport.min.y, viewport.width, viewport.height);

		_cameraLocation.render(&renderScene);

		glPopAttrib();
	}

	abstract void renderScene();

	Matrix44 cameraLocation() { return _cameraLocation; }
	protected Matrix44 cameraLocation(const Matrix44 rhs) { return _cameraLocation = rhs; }

	private {
		Matrix44	_cameraLocation;
	}
}
